﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLBS.Entity;

namespace NLBS.Data.Interface
{
    public interface ICommentService
    {
        #region Comment

         IList<Comment> GetCommentList();

         IPagedCollection<Comment> GetCommentBySearch(int startIndex, int pageSize, string prefix);

        /// <summary>
        /// 获取日志评论
        /// </summary>
        /// <param name="articleID"></param>
        /// <returns></returns>
         IList<Comment> GetCommentListByArticleID(int articleID);

        /// <summary>
        /// 获取用户评论
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
         IList<Comment> GetCommentListByUserID(int userID);

        /// <summary>
        /// 获取一个评论
        /// </summary>
        /// <param name="commID"></param>
        /// <returns></returns>
         Comment GetCommentByID(int commID);

        /// <summary>
        /// 添加一条评论
        /// </summary>
        /// <param name="comm"></param>
        /// <returns></returns>
         int InsertComment(Comment comm);

        /// <summary>
        /// 更新一个评论
        /// </summary>
        /// <param name="comm"></param>
         void UpdateComment(Comment comm);

        /// <summary>
        /// 删除一条评论
        /// </summary>
        /// <param name="commID"></param>
         void DeleteComment(int commID);

        /// <summary>
        /// 获取最新评论
        /// </summary>
        /// <param name="intCount"></param>
        /// <returns></returns>
         IList<Comment> GetTopComment(int intCount);

        /// <summary>
        /// 获取评论总数
        /// </summary>
        /// <returns></returns>
         int GetAllCommentCount();

        /// <summary>
        /// 分页获取评论
        /// </summary>
        /// <param name="startIndex">起始页</param>
        /// <param name="pageSize">每页显示评论数</param>
        /// <returns></returns>
         IPagedCollection<Comment> GetAllCommentByPage(int startIndex, int pageSize);

        /// <summary>
        /// 更新评论数
        /// </summary>
        /// <param name="logID"></param>
        /// <param name="authorID"></param>
         void UpdateCommentCount(int logID, int authorID);
        #endregion
    }
}
